#include <stdio.h>
#include <signal.h>
#include <iostream>
#include <ctime>
using std::cout;
using std::endl;

void SignalCtrlC (int sig) 
{    
    time_t t = time(0);
    cout << ctime(&t) << endl;
}  

int main (int argc, char *argv []) 
{
    signal (SIGINT, SignalCtrlC);
    char c = 0;
    while (c!='q')
        c = getchar( );
}

